#include "stm32f10x.h" // Device header
#include "OLED.h"

// 修改函数参数名和类型
void LED_control(uint8_t id, uint8_t power, uint8_t brightness){
    switch (id) {
        case 1: {
            // 关闭LED
            if(power == 0){
                TIM_SetCompare2(TIM2, 0);
                return;
            };
            // 设置亮度
            if(brightness > 0 && brightness <= 100) {
                TIM_SetCompare2(TIM2, brightness);	
            }
            break;
        }
        case 2: {
            if(power == 0){
                TIM_SetCompare3(TIM2, 0);
                return;
            };
            if(brightness > 0 && brightness <= 100) {
                TIM_SetCompare3(TIM2, brightness);	
            }
            break;
        }
        case 3: {
            if(power == 0){
                TIM_SetCompare4(TIM2, 0);
                return;
            };
            if(brightness > 0 && brightness <= 100) {
                TIM_SetCompare4(TIM2, brightness);	
            }
            break;
        }
    }
}